home *** CD-ROM | disk | FTP | other *** search
- Path: quadostimpy.natinst.com!user
- From: rcauvin@natinst.com (Roger L. Cauvin)
- Newsgroups: comp.lang.c++
- Subject: Re: Inheritance and function signatures
- Date: 11 Mar 1996 20:39:36 GMT
- Organization: National Instruments
- Message-ID: <rcauvin-1103961444450001@quadostimpy.natinst.com>
- References: <MANOWAR.96Mar11132010@dilo.engin.umich.edu> <31447542.6E69@cs.tu-berlin.de>
- NNTP-Posting-Host: quadostimpy.natinst.com
-
- In article <31447542.6E69@cs.tu-berlin.de>, Roman Lechtchinsky
- <wolfro@cs.tu-berlin.de> wrote:
-
- > Krisztian Flautner wrote:
- > >
- > > It seems that function signitures are not properly inherited. Is this
- > > a bug or a feature ?
- > >
- >
- > A function defined in a derived class hides all inherited functions with the
- > same name. It is defined this way in the April draft as well as in the
- > original language. Use a qualifier to correct this problem: bb->A::print() (
- > and thank God it's not a virtual function ). A rather annoying rule, isn't
- > it?
-
- Or you can use an access declaration to make the base class functions
- visible in the derived class:
-
- class Base
- {
- public:
- void Foo(void);
- void Foo(int);
- };
-
- class Derived : public Base
- {
- public:
- Base::Foo; // Access declaration to make base class Foo visible.
- void Foo(int, int);
- };
-
- Roger
-
- ---
-
- Roger L. Cauvin
- rcauvin@natinst.com
- Software Engineer
- National Instruments
-